package com.example.bob.service;

import com.example.bob.dao.UserMapper;
import com.example.bob.model.ArticleInfo;
import com.example.bob.model.UserInfo;
import com.example.bob.model.vo.UserInfoVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    //@Autowired  也只是冒波浪线，并不是报错（但是我有点强迫症啊！）
    @Resource
    private UserMapper userMapper;

    //注册用户
    public int regUserInfo(UserInfo userInfo){
        return userMapper.addUserInfo(userInfo);
    }


    //用户登录
    public UserInfo getUserByName(String username){
        return userMapper.getUserByName(username);
    }


    public UserInfoVO getUserById(int uid) {
        return userMapper.getUserById(uid);
    }
}
